package com.example.lianxi222.adapter;

import android.widget.ImageView;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.example.lianxi222.R;
import com.example.mvvm_base.userbean.CommentEntity;
import java.util.List;

public class CommentAdapter extends BaseQuickAdapter<CommentEntity.DataBean, BaseViewHolder> {

    public CommentAdapter( @Nullable List<CommentEntity.DataBean> data) {
        super(R.layout.item_comment, data);
    }

    @Override
    protected void convert(@NonNull BaseViewHolder baseViewHolder, CommentEntity.DataBean dataBean) {
        baseViewHolder.setText(R.id.comment_msg,dataBean.getMsg());
        baseViewHolder.setText(R.id.comment_time,dataBean.getCreatetime());
        ImageView iv=baseViewHolder.getView(R.id.shot_comment);
        Glide.with(getRecyclerView()).load(dataBean.getIcon()).circleCrop().into(iv);
        baseViewHolder.setText(R.id.comment_user,dataBean.getUsername());
    }
}
